package com.ccys.app.controller;


import com.ccys.app.service.MemberMoreService;
import com.ccys.app.service.MemberService;
import com.ccys.common.constants.ContextConstants;
import com.ccys.common.constants.TouristApi;
import com.ccys.common.vo.ResponseResultApp;
import com.ccys.db.dto.CommonDto;
import com.ccys.db.dto.login.*;
import com.ccys.db.dto.member.*;
import com.ccys.db.vo.member.MemberECardVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@Api(tags = "病人个人中心接口")
@RequestMapping("Member")
public class MemberMoreController {

    @Autowired
    private MemberMoreService memberMoreService;


    //Member/GetProfile 接口 Same as GP  以GP中的接口相同 张 已写

    @ApiOperation("查询电子卡片")
    @GetMapping(value = "/GetMemberECard")
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = MemberECardVO.class),
    })
    public ResponseResultApp GetMemberECard(CommonDto dto){
        return this.memberMoreService.getMemberECard(dto);
    }

    @ApiOperation("查询预约历史记录列表")
    @GetMapping(value = "/GetAppointmentHistories")
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = ResponseResultApp.class),
    })
    public ResponseResultApp getAppointmentHistories(CommonDto dto){
        return this.memberMoreService.getAppointmentHistories(dto);
    }


    @ApiOperation("查询预约取消理由")
    @GetMapping(value = "/GetAppointmentCancellationReasons")
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = ResponseResultApp.class),
    })
    public ResponseResultApp getAppointmentCancellationReasons(AppointmentCancellationReasonsDto dto){
        return this.memberMoreService.getAppointmentCancellationReasons(dto);
    }


    @ApiOperation("取消预约")
    @PostMapping(value = "/CancelAppointmentBooking")
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = ResponseResultApp.class),
    })
    public ResponseResultApp CancelAppointmentBooking(CancelAppointmentBookingDto dto){
        return this.memberMoreService.cancelAppointmentBooking(dto);
    }


    @ApiOperation("设置实验室结果提醒")
    @PostMapping(value = "/SetLabResultReminder")
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = ResponseResultApp.class),
    })
    public ResponseResultApp setLabResultReminder(SetLabResultReminderDto dto){
        return this.memberMoreService.setLabResultReminder(dto);
    }

    @ApiOperation("分享实验报告")
    @PostMapping(value = "/ShareLaboratoryResultViaEmail")
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = ResponseResultApp.class),
    })
    public ResponseResultApp shareLaboratoryResultViaEmail(ShareLaboratoryResultViaEmailDto dto){
        return this.memberMoreService.shareLaboratoryResultViaEmail(dto);
    }


    @ApiOperation("更新过敏和药物反应")
    @PostMapping(value = "/UpdateAllergiesAndMedicationReactions")
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = ResponseResultApp.class),
    })
    public ResponseResultApp UpdateAllergiesAndMedicationReactions(@RequestBody UpdateAllergiesAndMedicationReactionsDto dto){
        return this.memberMoreService.updateAllergiesAndMedicationReactions(dto);
    }



    /*@ApiOperation("查询家庭成员")
    @GetMapping(value = "/Family")
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = ResponseResultApp.class),
    })
    public ResponseResultApp Family(CommonDto dto){
        return this.memberMoreService.getFamilyList(dto);
    }*/


    @ApiOperation("删除分享孩子")
    @DeleteMapping(value = "/RemoveSharedChild")
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = ResponseResultApp.class),
    })
    public ResponseResultApp RemoveSharedChild(@RequestBody RemoveSharedChildDto dto){
        return this.memberMoreService.removeSharedChild(dto);
    }


    @ApiOperation("删除孩子")
    @DeleteMapping(value = "/DeleteChild")
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = ResponseResultApp.class),
    })
    public ResponseResultApp DeleteChild(@RequestBody RemoveSharedChildDto dto){
        return this.memberMoreService.deleteChild(dto);
    }



    @ApiOperation("更新孩子Profile")
    @DeleteMapping(value = "/UpdateChildProfile")
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = ResponseResultApp.class),
    })
    public ResponseResultApp UpdateChildProfile(@RequestBody RemoveSharedChildDto dto){
        return this.memberMoreService.updateChildProfile(dto);
    }



    @ApiOperation("getConsultProfiles")
    @GetMapping(value = "/GetConsultProfiles")
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = ResponseResultApp.class),
    })
    public ResponseResultApp GetConsultProfiles(ConsultProfilesDto dto){
        return this.memberMoreService.getConsultProfiles(dto);
    }

    @ApiOperation("deleteAccount")
    @PostMapping(value = "/DeleteAccount")
    public ResponseResultApp deleteAccount(@RequestBody DeleteAccountDto dto){
        return memberMoreService.deleteAccount(dto);
    }


}
